import pandas as pd

# 1.字符串索引
data = ["google", "baidu", "facebook"]
custom_index = ["x", "y", "z"]
series_a = pd.Series(data, index=custom_index)
print(series_a)
""" 
x      google
y       baidu
z    facebook
dtype: object
"""

# 2.字典dict索引
dict_data = {
    1: "google",
    2: "baidu",
    3: "facebook"
}
series_b = pd.Series(dict_data,name="dict_data")
print(series_b)
""" 
dtype: object
1      google
2       baidu
3    facebook
Name: dict_data, dtype: object
"""